<template>
    <div class="pinglun">
        <el-row>
            <div class="grid-content bg-purple-light">
                <div class="grid-content bg-purple">
                    <div class="new-comment ">
                        <el-col :xs="4" :sm="3" :md="2" :lg="2" :xl="1">
                            <div class="grid-content bg-purple">
                                <a href>
                                    <img src="../../assets/ContNavimg/10.png" alt>
                                </a>
                            </div>
                        </el-col>
                        <el-col :xs="18" :sm="21" :md="22" :lg="22" :xl="23">
                            <div>
                                <input class="btn grid-content bg-purple" type="text" placeholder="写下你的评论..." v-model="msg" @keydown.enter="addTodo" @click="Switch">
                                <div class="fabiao" v-if="isShows">
                                    <el-col :span="4" :xs="8">
                                        <i class="layui-icon layui-icon-face-smile-b"></i>
                                    </el-col>
                                    <el-col :span="14" :xs="6" class="hidden-xs-only">
                                            <p>Ctrl+Enter 发表</p>
                                    </el-col>
                                    <el-col :span="6" :xs="16">
                                        <button @click="Switch1">取消</button>
                                        <button @click="addTodo">发送</button>
                                    </el-col>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="24" :xs="24">
                            <div class="top-title">
                                <p>4条评论</p>
                            </div>
                        </el-col>
                        <el-col :span="24" :xs="24">
                            <el-divider></el-divider>
                        </el-col>
                    </div>
                </div>
            </div>
            <div class="pinglunneirong">
                <ul>
                    <li v-for="(item,index) in goods" :key="index" @click="removeItem(index)">
                        <el-col :span="2" :xs="3">
                            <img src="../../assets/pl1.jpeg" alt="">
                        </el-col>
                        <el-col :span="16" :xs="16">
                            <h3>这个名字可以吧</h3>
                            <p>{{index}}楼·2019.6.20 14:23</p>
                        </el-col>
                        <el-col :span="24" :xs="24">
                            <p>{{item}}</p>
                        </el-col>
                        <el-col :span="23" :xs="24" class="fenge">
                            <i class="el-icon-thumb"> 赞</i>
                            <i class="el-icon-chat-square"> 回复</i>
                        </el-col>
                    </li>
                </ul>
            </div>
        </el-row>
    </div>
</template>
<script>
    import 'element-ui/lib/theme-chalk/display.css';

    export default {
        data(){
            return{
                isShows:false,
                goods:[],
                index:''
            }
        },
        methods:{
            Switch(){
                this.isShows=true
            },
            Switch1(){
                this.isShows=false
            },
            addTodo(){
                this.goods.push(this.msg),
                this.msg=''
            }
        }
    };
</script>
<style scoped>
    /* .el-row {
        margin-bottom: 20px;
        &:last-child {
          margin-bottom: 0;
        }
      } */
    .pinglun {
        width: 50%;
        margin: 0 auto;
    }

    .el-col {
        border-radius: 4px;
    }

    /* .bg-purple-dark {
      background: #99a9bf;
    } */
    /* .bg-purple {
      background: #d3dce6;
    } */
    /* .bg-purple-light {
      background: #e5e9f2;
    } */
    .grid-content {
        border-radius: 4px;
        min-height: 36px;
    }

    .row-bg {
        /*padding: 10px 0;*/
        background-color: #f9fafc;
    }

    .new-comment img {
        height: 38px;
        width: 38px;
        border-radius: 500px;
        border: 1px solid #dcdcdc;
    }

    .btn {
        width: 95%;
        padding: 5px 10px 50px 10px;
        margin: 0 auto;
        background: hsla(0, 0%, 71%, .1);
        border: 1px solid #dcdcdc;
    }

    .btn-1 {
        margin-top: 26px;
    }

    .btn-1 span {
        font-size: 14px;
        /*padding-left: 5px;*/
    }

    .top-title, .top-title-2 {
        margin-top: 15px;
    }

    .top-title p {
        font-weight: bold;
        color: #333333;
    }
    .fabiao{
        line-height: 30px;
        font-size: 14px;
        color: #969696;
        margin-top: 20px;
    }
    .fabiao i{
        font-size: 18px;
    }
    .fabiao button{
        font-size: 16px;
        padding: 5px 20px;
        border: 0 ;
        border-radius: 25px;
        background-color: #0eba43;
    }
    .fabiao button:nth-of-type(1){
        color: #969696;
        background-color: #fff;
        margin-right: 10px;
    }
    .fabiao button:nth-of-type(2){
        color: #fff;
    }
    .pinglunneirong img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
    }
    .pinglunneirong h3{
        font-size: 15px;
        color: #333333;
    }
    .pinglunneirong .el-col-16 p {
        font-size: 12px;
        color: #969696;
    }
    .pinglunneirong .el-col-24 p {
        margin: 10px 0 10px 20px;
        font-size: 16px;
        color: #333333;
    }
    .pinglunneirong i {
        font-size: 13px;
        color:#969696;
        margin-left: 10px;
    }
    .pinglunneirong .fenge{
        padding-bottom: 25px;
        margin-bottom: 5px;
        border-bottom: 1px solid #f0f0f0;
    }
    @media screen and (max-width: 750px){
        .pinglun{
            width: 90%;
            padding: 0 5% 0 5%;
        }
        .fabiao {
            text-align: center;
        }
    }
</style>